package com.shanhai.wallpapers.network.api

import com.shanhai.wallpapers.network.response.WallpapersResponse
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Query
import retrofit2.http.Streaming
import retrofit2.http.Url

interface PexelsApi {
    @Headers("Authorization: cX5AQeMnKkf53svAicXFsw81TB5XLMebQiLbDl4hkusVJ5SQdqadaqrK")
    @GET("search")
    suspend fun getWallPapers(
        @Query("query") query: String,
        @Query("page") page: Int
    ): Response<WallpapersResponse>

    @Streaming
    @GET
    suspend fun downloadWallpaper(@Url url: String): ResponseBody
}